<?php

/***  DOCUMENTATION LAYER

Ceo Sample Unit Test

Last Update: Aug 2007
  
DESCRIPTION
  this file provides a template for other simple unit tests.
  
NOTES
  $test_root dynamically sets root in order to keep tests working after
  they are moved to the __REPOSITORY directory
    
______________________________________________________________________________*/

$_tx0 = microtime();
$test_root = ( strpos(dirname(__FILE__), 'repository') === false ) ? '' : '../';


// Test Name
$test_name = 'ace hash test';

// Include Files
require_once($test_root . '../php_ceo/ext/ace/ace.class.php');

// Configure Test
$debug = 1;


// Test Procedure
$Test = new CeoAce($debug);

// test hash
$PT = array( '', 'love', 'sex69', 'test', 'qwerty', 'god');
$PT = array ( 'admin', 'member', 'guest', 'inactive', 'troll', 'does not exist' );
foreach ( $PT as $_pt )
{
  $hash = $Test->_hash($_pt);
  $Test->print_d("plaintext + salt[{$Test->hash_salt}] -> hash  ===> {$_pt} -> {$hash}");
}


// Footer
$_txn = microtime();
$stx = number_format(((substr($_txn,0,9)) + (substr($_txn,-10)) - (substr($_tx0,0,9)) - (substr($_tx0,-10))),4); 
echo "<h6>test '$test_name' complete in $stx s</h6>";
?>
